package com.redstar.interesting.main.hello.controller;

import com.redstar.interesting.main.hello.param.HomeworkParam;
import com.redstar.interesting.main.hello.po.Homework;
import com.redstar.interesting.main.hello.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author lihongxing
 */
@RestController
@RequestMapping("/hello")
public class Hello1Controller {


    @Autowired
    private HelloService helloService;


    @GetMapping("getByTitle")
    public Homework selectByTitle(String title) {
        return helloService.selectByTitle(title);
    }

    @GetMapping("addHomework")
    public Integer addHomework() {
        return helloService.addHomework();
    }

    @PostMapping("modifyTitle")
    public Integer modifyTitle(@RequestBody HomeworkParam param) {
        return helloService.modifyTitle(param);
    }

    @GetMapping("deleteById")
    public Integer deleteById(Long id) {
        return helloService.deleteById(id);
    }

}
